<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- 
    navigator对象
      navigator对象包含有关浏览器的信息，最常用的就是userAgent
        判断用户哪个终端打开页面
  -->
  <script>
    if ((navigator.userAgent.match(/(phone|pad|pad|iphone|ipod|ios|Android|Mobile)/i))) {
      window.location.href = ""; //手机
    } else {
      window.location.href = ""; //电脑
    }
  </script>
</body>

</html>